/**
 * @file  main.cpp
 * @author Chensili <3190104816@zju.edu.cn>
 * @date Thur Oct 8 2020
 * 
 * @brief Generate random Student information, includeing student number,
 major and GPA.
 *
 */

#include <iostream>
#include <cstdlib>
#include <ctime>
#include <random>

using namespace std;

int generate_std_no()
{
  int std_no = 319;
  for (int i = 0; i < 4; i++)
    {
      random_device e;
      std_no = std_no*10 + e()%10;
    }
  return std_no;
};

char generate_major()
{
  char Major[3] = {'M', 'P', 'C'};
  random_device e;
  return Major[e()%3];
};

double generate_GPA()
{
  random_device e;
  double m1 = (double)(e()%5);
  double m2 = (double)(e()%5) / 5;
  
  return m1 + m2;
};

int main()
{
  int n ;
  random_device e;
  n =  e()%200;
  cout << n << endl;
  int std_no;
  char major;
  double GPA;
  for (int i = 0; i < n; i++)
    {
      std_no = generate_std_no();
      major = generate_major();
      GPA = generate_GPA();
      cout << std_no << ' ' <<  major << ' ' << GPA << endl;
    };
  return 0;
};
